package com.xlh.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * 用户常量
 * <p>
 * Created by lx on 2019/2/18.
 */
public class UserConstant {

    /**
     * 验证码session的key
     */
    public static final String CODE_SESSION_KEY = "TES_IMAGE_CODE";

    /**
     * 验证码session失败的次数
     */
    public static final String CODE_FAIL_NUM = "TES_IMAGE_CODE_FAIL_NUM";

    /**
     * 验证码过期时间
     */
    public static final Integer CODE_EXPIRED_TIME = 60 * 10;

    /**
     * 短信验证码session的key
     */
    public static final String SMS_CODE_SESSION_KEY = "TES_SMS_CODE";

    /**
     * 手机号session的key
     */
    public static final String MOBILE_TEL_SESSION_KEY = "TES_MOBILE_TEL";

    /**
     * 短信验证码过期时间
     */
    public static final Integer SMS_CODE_EXPIRED_TIME = 60 * 2;

    /**
     * 发送短信验证码失败的key
     */
    public static final String SMS_SEND_FAIL_SESSION_KEY = "TES_SMS_SEND_FAIL";

    /**
     * 发送短信验证码失败过期时间
     */
    public static final Integer SMS_SEND_FAIL_EXPIRED_TIME = 60 * 5;

    /**
     * 用户常用ip总数
     */
    public static final Integer COMMON_IP_COUNT = 15;

    /**
     * 邮箱正则
     */
    public static final String REGEX_EMAIL = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,6}$";

    /**
     * 密码正则
     * 必须是数字和英文
     * ^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,14}
     */
    public static final String REGEX_PASSWORD = "^[0-9A-Za-z]{6,14}$";

    /**
     * 纯数字验证
     */
    public static final String REGEX_NUMBER = "^\\d+$";

    /**
     * 根据ip获取详细信息接口地址
     */
    public static final String GET_REGION_URL = "http://ip.taobao.com/service/getIpInfo.php?ip={}";

    /**
     * 初始化密码
     */
    public static final String INIT_PASSWORD = "000000";

}


